/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "hos_prescripciones")
@NamedQueries({
    @NamedQuery(name = "HosPrescripciones.findAll", query = "SELECT h FROM HosPrescripciones h")})
public class HosPrescripciones implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "hpr_id")
    private Integer hprId;
    @Size(max = 2147483647)
    @Column(name = "hpr_observacion")
    private String hprObservacion;
    @OneToMany(mappedBy = "hosPrescripciones", fetch = FetchType.LAZY)
    private List<HosControlMedicamentos> hosControlMedicamentosList;
    @JoinColumn(name = "hev_id", referencedColumnName = "hev_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private HosEvolucion hosEvolucion;

    public HosPrescripciones() {
    }

    public HosPrescripciones(Integer hprId) {
        this.hprId = hprId;
    }

    public Integer getHprId() {
        return hprId;
    }

    public void setHprId(Integer hprId) {
        this.hprId = hprId;
    }

    public String getHprObservacion() {
        return hprObservacion;
    }

    public void setHprObservacion(String hprObservacion) {
        this.hprObservacion = hprObservacion;
    }

    public List<HosControlMedicamentos> getHosControlMedicamentosList() {
        return hosControlMedicamentosList;
    }

    public void setHosControlMedicamentosList(List<HosControlMedicamentos> hosControlMedicamentosList) {
        this.hosControlMedicamentosList = hosControlMedicamentosList;
    }

    public HosEvolucion getHosEvolucion() {
        return hosEvolucion;
    }

    public void setHosEvolucion(HosEvolucion hosEvolucion) {
        this.hosEvolucion = hosEvolucion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hprId != null ? hprId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HosPrescripciones)) {
            return false;
        }
        HosPrescripciones other = (HosPrescripciones) object;
        if ((this.hprId == null && other.hprId != null) || (this.hprId != null && !this.hprId.equals(other.hprId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.HosPrescripciones[ hprId=" + hprId + " ]";
    }
    
}
